import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '',
    redirect: '/login'
  },
  // 登录页
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue')
  },
  // 首页
  {
    path: '/home',
    name: 'home',
    component: () => import('@/layout/index.vue'),
    children: [
      {
        path: '/home',
        redirect: '/home/active',
      },
      // 助力活动
      {
        path: 'active',
        name: 'active',
        component: () => import('@/views/home/active.vue')
      },
      // 新闻报道
      {
        path: 'news',
        name: 'news',
        component: () => import('@/views/home/news.vue')
      },
      // 成才典范
      {
        path: 'successModel',
        name: 'successModel',
        component: () => import('@/views/home/successModel.vue')
      },
      // 成才指南
      {
        path: 'successGuide',
        name: 'successGuide',
        component: () => import('@/views/home/successGuide.vue')
      },
      // 导师风采
      {
        path: 'mentor',
        name: 'mentor',
        component: () => import('@/views/home/mentorDemeanor.vue')
      },
      // 文章编辑
      {
        path: 'paperEdit',
        name: 'paperEdit',
        component: () => import('@/views/home/paperEdit.vue')
      },
      // 用户列表
      {
        path: 'userList',
        name: 'userList',
        component: () => import('@/views/home/userList.vue')
      },
      // 选择学生
      {
        path: 'selectData',
        name: 'selectData',
        component: () => import('@/views/home/selectData.vue')
      },
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
